﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta charset="UTF-8"></meta>
		<title>管理员查询</title>
		<link rel="stylesheet" th:href="@{/plugins/layui/css/layui.css}" media="all" />
	</head>

	<body>
            
<!--             <blockquote class="layui-elem-quote" > -->
					
<form class="layui-form" method="post" action="#" id="passwordForm" >
  <div class="layui-form-item">
    <label class="layui-form-label">账号：</label>
    <div class="layui-inline">
      <input type="text" name="userAccount" lay-verify="required" th:value="${manage.userAccount}" autocomplete="off" placeholder="请输入账号" class="layui-input"/>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">密码：</label>
    <div class="layui-inline">
      <input type="passWord" id="passWord" name="passWord" placeholder="请输入密码" autocomplete="off" class="layui-input"/>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">确认密码：</label>
    <div class="layui-inline">
      <input type="passWord" id="passWords"  name="passWords" placeholder="请输入新密码" autocomplete="off" class="layui-input"/>
    </div>
  </div>
  <div></div>
    <div style="margin:10px;text-align:center" >
    <ul  text-align="right" font-size="15px">
	<button lay-submit="" lay-filter="gos" class="layui-btn  layui-btn-normal">提交 </button>
     </ul>
  </div>
</form>
		<!-- 	</blockquote> -->
			
    
			  
        
        
		        <script type="text/javascript" th:src="@{/plugins/layui/layui.js}"></script>
        <script>
        layui.use('element', function () {
            var element = layui.element;
        });
        layui.use('form', function () {
            var form = layui.form;
            $ = layui.jquery;
            // 这个是在iframe里面的js代码
            var frameindex = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            form.on('submit(gos)', function (data) {
            	var passWord = document.getElementById("passWord").value;
            	var passWords = document.getElementById("passWords").value;
            	if(passWord!=passWords){
            		 layer.msg("两次密码不一致！");
            		 return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            	}
                console.log(data.field); //当前容器的全部表单字段，名值对形式：{name: value}
                var index = layer.load(1, {
                    shade: [0.1, '#fff'] //0.1透明度的白色背景
                });
                var url = '/merchant/setting/changePassWordSave';
                $.post(url, data.field, function (ev) {                	
                    if (ev.code == 000000) {
                        layer.msg(ev.msg);
                    	layer.close(index);
                        parent.location.href = "/merchant/setting/manage"; 
                    } else {
                        layer.close(index);
                        layer.msg(ev.msg);
                    }
                }, 'json')
                //发送ajax
                return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            });
        });
    </script>

 
</body>
</html>